package com.chenxin.wms.service.impl;

import com.chenxin.wms.domain.IbDetailEntity;
import com.chenxin.wms.domain.po.IbDetailInfo;
import com.chenxin.wms.domain.vo.IbDetailVO;
import com.chenxin.wms.mapper.IbDetailMapper;
import com.chenxin.wms.service.IIbDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 入库明细单Service业务层处理
 *
 * @author gry
 * @date 2025-04-14
 */
@Service
public class IbDetailServiceImpl implements IIbDetailService {
    @Autowired
    private IbDetailMapper ibDetailMapper;

    @Override
    public IbDetailVO selectIbDetailById(Long ibDetailId) {
        return ibDetailMapper.selectIbDetailViewById(ibDetailId);
    }

    /**
     * 查询入库明细单列表
     *
     * @param detailVo 入库明细单
     * @return 入库明细单
     */
    @Override
    public List<IbDetailVO> selectIbDetailList(IbDetailVO detailVo) {
        return ibDetailMapper.selectIbDetailViewList(detailVo);
    }

    /**
     * 新增入库明细单
     *
     * @param ibDetailEntity 入库明细单
     * @return 结果
     */
    @Override
    public int insertIbDetail(IbDetailEntity ibDetailEntity) {
        return ibDetailMapper.insert(ibDetailEntity);
    }

    /**
     * 修改入库明细单
     *
     * @param ibDetailEntity 入库明细单
     * @return 结果
     */
    @Override
    public int updateIbDetail(IbDetailEntity ibDetailEntity) {
        return ibDetailMapper.updateById(ibDetailEntity);
    }
}
